#pragma once

#include <Eigen/Dense>
#include <vector>

namespace  ldl_eigen
{
/**
 * Utility class for converting between std::vector and Eigen matrices/vectors.
 */
class VectorEigenConverter 
{
public:
    // Convert a 2D vector (std::vector<std::vector<double>>) to an Eigen::MatrixXf
    static Eigen::MatrixXf to_eigen_matrix(const std::vector<std::vector<double>>& vec);

    // Convert a 1D vector (std::vector<double>) to an Eigen::VectorXf
    static Eigen::VectorXf to_eigen_vector(const std::vector<double>& vec);

    // Convert an Eigen::MatrixXf to a 2D vector (std::vector<std::vector<double>>)
    static std::vector<std::vector<double>> to_vector_2d(const Eigen::MatrixXf& mat);

    // Convert an Eigen::VectorXf to a 1D vector (std::vector<double>)
    static std::vector<double> to_vector_1d(const Eigen::VectorXf& vec);
};
}
